package com.wl.jetpackdemo.chat.emoji

import android.util.Log
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.wl.jetpackdemo.R

/**
 *
 * Created by wangliang on 2021/2/20.
 */
class EmojiAdapter : BaseQuickAdapter<Emoticon, BaseViewHolder>(R.layout.item_emoji) {
    override fun convert(holder: BaseViewHolder, item: Emoticon) {

        var fileuri = "file:///android_asset/emoticon/${item.filename}"
        Log.d("WLTest", "emo ${fileuri}")
        Glide.with(context).load(fileuri)
                .transition(DrawableTransitionOptions.withCrossFade())
                .into(holder.getView(R.id.iv_emoji))
    }
}